public class Student {
    String name;
    final int id;
    static final int courses=5;
    Course[] grades;
    public Student(String name, int id, Course[] grades) {
        this.name = name;
        this.id = id;
        this.grades = grades;    }
    public int getId() {
        return id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    double ave(){
        double sum=0.0;
        for(Course c:grades){
            sum+= c.score;
        }
        return sum/grades.length;
    }
    public static void main(String[] args) {
        double[] cs=new double[3];
        Course[] cn=new Course[3];
        cn[0]=new Course("yuwen",56.3);
        cn[1]=new Course("shuxue",74.3);
        cn[2]=new Course("yingyu",89.0);
        Student student1=new Student("wangjianhua",2040,cn);
        double a=student1.ave();
        System.out.println(a);    }
}







